package com.vhall.component.service.redpacket.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author xuyongzheng
 * @since 2021/3/20 21:12
 **/
@Getter
@AllArgsConstructor
public enum RefundStatus {


    /**
     * 0-未退款状态
     */

    WAIT(0, "未退款"),
    /**
     * 1-已退款状态
     */
    SUCCESS(1, "已退款"),

    /**
     * 2=退款失败状态
     */
    FAIL(2, "退款失败");

    private final int code;
    private final String mark;

    public static RefundStatus valueOf(Integer code) {
        return Arrays.stream(values()).filter(type -> type.getCode() == code).findFirst().orElse(null);
    }
}
